<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>DI_TEXT</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../styles/styles.css">
<script language="javascript" src='../../links.js' type="text/javascript"></script>
</head>
<body>

<h1>DI_TEXT</h1>
<div class=navbar>
<a href="../../index.html">main</a> |
<a href="../index.html">Dialog API</a> |
<a href="index.html">Dialog items</a><br>
</div>

<div class=shortdescr>The <dfn>DI_TEXT</dfn> dialog item describes a static text label.</div>

<pre class=syntax>
struct FarDialogItem
{
  int Type          = <b>DI_TEXT</b>
  int X1            = <b>X1</b>
  int Y1            = <b>Y</b>
  int X2            = <b>X2</b>
  int Y2            = <b>Y</b> (not used in Dialog API 1.0, must be equal to Y1)
  int Focus         = <b>0</b>
  int Selected      = <b>0</b>
  DWORD Flags       = <b>Flags</b>
  int DefaultButton = <b>0</b>
  char Data[512]    = <b>text label</b>
};
</pre>
<p class=note><img src="../../../images/note.gif" alt="Attention!" width="10" height="10"> Attention!</p>
<UL class=note>
  <LI>This is an exemplary structure; read full description <a href="../structures/fardialogitem.html">here</a>.</LI>
</UL>

<h3>Flags</h3>
<div class=descr>
There are several flags applicable to the <dfn>DI_TEXT</dfn> control:<br>
<table class="cont">
<tr class="cont"><th class="cont" width="40%">Flag</th><th class="cont" width="60%">Description</th></tr>
 <tr class="cont"><td class="cont" width="40%"><a href="../flags/dif_setcolor.html">DIF_SETCOLOR</a></td>
 <td class="cont" width="60%">
 The low byte of Flags will be used as the item's color.</td>
 </tr>
 <tr class="cont"><td class="cont" width="40%"><a href="../flags/dif_boxcolor.html">DIF_BOXCOLOR</a></td>
 <td class="cont" width="60%">
 The text item will be displayed using frame color (<a href="../../defs/farcolors.html#COL_DIALOGBOX">COL_DIALOGBOX</a> or <a href="../../defs/farcolors.html#COL_WARNDIALOGBOX">COL_WARNDIALOGBOX</a>)
 </td>
 </tr>
 <tr class="cont"><td class="cont" width="40%"><a href="../flags/dif_centergroup.html">DIF_CENTERGROUP</a></td>
 <td class="cont" width="60%">
 Sequential strings with this flag set and equal vertical coordinates will be horizontally centered in the dialog. Their X1 and X2 coordinates are ignored.</td>
 </tr>
 <tr class="cont"><td class="cont" width="40%"><a href="../flags/dif_separator.html">DIF_SEPARATOR</a></td>
 <td class="cont" width="60%">
 Draws a single-line separator. You may write any text on the separator line, just use Data and the coordinate fields.</td>
 </tr>
 <tr class="cont"><td class="cont" width="40%"><a href="../flags/dif_separator2.html">DIF_SEPARATOR2</a></td>
 <td class="cont" width="60%">
 Draws a double-line separator. You may write any text on the separator line, just use Data and the coordinate fields.
 </td>
 </tr>
 <tr class="cont"><td class="cont" width="40%"><a href="../flags/dif_showampersand.html">DIF_SHOWAMPERSAND</a></td>
 <td class="cont" width="60%">
 Show ampersand symbol in caption instead of using it for defining hotkeys.</td>
 </tr>
 <tr class="cont"><td class="cont" width="40%"><a href="../flags/dif_centertext.html">DIF_CENTERTEXT</a></td>
 <td class="cont" width="60%">Centers the text between the X1 and X2 coordinates.</td>
 </tr>
</table>
</div>

<h3>Events</h3>
<div class=descr>
<table class="cont">
<tr class="cont"><th class="cont" width="40%">Event</th><th class="cont" width="60%">Description</th></tr>

 <tr class="cont"><td class="cont" width="40%"><a href="../dmsg/dn_drawdlgitem.html">DN_DRAWDLGITEM</a></td>
 <td class="cont" width="60%">This event is sent to the dialog callback function just before the text item is drawn.</td>
 </tr>
 <tr class="cont"><td class="cont" width="40%"><a href="../dmsg/dn_ctlcolordlgitem.html">DN_CTLCOLORDLGITEM</a></td>
   <td class="cont" width="60%">Plugin should pass the color attributes of the text item when this event comes. Param2 parameter (foreground+background):
     <pre>LoWord LoByte - color of the text
                (<a href="../../defs/farcolors.html#COL_WARNDIALOGTEXT">COL_WARNDIALOGTEXT</a> or
                 <a href="../../defs/farcolors.html#COL_DIALOGTEXT">COL_DIALOGTEXT</a>).
                If <a href="../flags/dif_boxcolor.html">DIF_BOXCOLOR</a> flag is set:
                 <a href="../../defs/farcolors.html#COL_WARNDIALOGBOX">COL_WARNDIALOGBOX</a> or
                 <a href="../../defs/farcolors.html#COL_DIALOGBOX">COL_DIALOGBOX</a>
LoWord HiByte - color of highlighted text
                (<a href="../../defs/farcolors.html#COL_WARNDIALOGHIGHLIGHTTEXT">COL_WARNDIALOGHIGHLIGHTTEXT</a> or
                 <a href="../../defs/farcolors.html#COL_DIALOGHIGHLIGHTTEXT">COL_DIALOGHIGHLIGHTTEXT</a>)
HiWord LoByte - 0 (not used)
HiWord HiByte - 0 (not used)</pre>
  If a special attribute is used (<a href="../flags/dif_setcolor.html">DIF_SETCOLOR</a> flag), the text (LoWord LoByte) will be drawn according to the parameters.</td>
 </tr>
 <tr class="cont"><td class="cont" width="40%"><a href="../dmsg/dn_mouseclick.html">DN_MOUSECLICK</a></td>
 <td class="cont" width="60%">This event comes after the user has clicked one of the dialog items or outside the dialog with the mouse button.</td>
 </tr>
 <tr class="cont"><td class="cont" width="40%"><a href="../dmsg/dn_hotkey.html">DN_HOTKEY</a></td>
 <td class="cont" width="60%">Hotkey was pressed (Alt-&lt;letter&gt;).</td>
 </tr>

</table>
</div>

<h3>Remarks</h3>
<div class=descr>
<ol>
<li>It is recommended to set the <var>Y2</var> coordinate correctly, although it's not used in Dialog
API 1.0. Just set it equal to the <var>Y1</var> coordinate.

<li>If the <a href="../flags/dif_centertext.html">DIF_CENTERTEXT</a> flag is set, the
<var>X2</var> field must have adequate value for the correct text centering.

<li>If the <a href="../flags/dif_centertext.html">DIF_CENTERTEXT</a> flag is not set,
FAR will calculate <var>X2</var> and <var>Y2</var> coordinates automatically.

<li>If this text item is the first in the dialog items array, the text string is copied into the FAR console window title.</li>

<li>If the text of the <dfn>DI_TEXT</dfn> item has a hotkey and <a href="../flags/dif_showampersand.html">DIF_SHOWAMPERSAND</a> flag isn't set,
then pressing <b>Alt-Letter</b> causes the <a href="../keybfocus.html">keyboard focus</a> to move to the next available dialog item.
</ol>
</div>


<div class=see>See also:</div><div class=seecont>
<a href="di_vtext.html">DI_VTEXT</a>,
<a href="../structures/fardialogitem.html">FarDialogItem</a>

</div>

</body>
</html>